import { NgModule ,SkipSelf,Optional } from '@angular/core';
import { CommonModule } from '@angular/common';
import { RouterModule }   from '@angular/router';
import { HeaderComponent } from './header/header.component';
import { FooterComponent } from './footer/footer.component';
import { LoginComponent } from './login/login.component';
import { FormsModule }   from '@angular/forms'; 
import { PublicModule } from '../public/public.module';
import {MatButtonModule,MatTabsModule} from '@angular/material';
//import {MatTabsModule} from '@angular/material/tabs';
import { UserRightService }from './services/userright.service';
import { LoginService }from './services/login.service';
import { ToastModule, } from 'primeng/toast';
import { PasswordModule ,InputTextModule} from 'primeng/primeng';
import { JurisdictionComponent } from './jurisdiction/jurisdiction.component';
import { NoauthorityComponent } from './noauthority/noauthority.component';
import { MessageComponent } from './header/message/message.component';
import { MessageorderComponent } from './header/message/messageorder/messageorder.component';
import { MessagestorageComponent } from './header/message/messagestorage/messagestorage.component';
import { MessagecontractComponent } from './header/message/messagecontract/messagecontract.component';
@NgModule({
  imports: [
    CommonModule,
    RouterModule,
    PasswordModule,
    FormsModule,
    PublicModule,
    MatButtonModule,
    MatTabsModule,
    InputTextModule,
    ToastModule
  ],
  declarations: [
    HeaderComponent,
    FooterComponent,
    LoginComponent,
    JurisdictionComponent,
    NoauthorityComponent,
    MessageComponent,
    MessageorderComponent,
    MessagestorageComponent,
    MessagecontractComponent
  ],
  exports:[
    HeaderComponent,
    FooterComponent,
    LoginComponent
  ],
  providers: [UserRightService, LoginService]
})
export class CoreModule {
  constructor(@Optional() @SkipSelf() parent:CoreModule){
    if(parent){
      throw new Error('共享模块已经加载，不能再次加载')
    }
  }
}
